<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<script>
$(document).ready(function(){
	$( "#tabs").tabs({collapsible:true});
	<c:if test="${requestScope.tabIndex != null}">
	$("#tabs").tabs({"active":${requestScope.tabIndex}});
	</c:if>
});
</script>
<body>
<div align="center"><img src="/${initParam.context_root }/img/ProductPerformance.jpg"></div>
<hr class="headline">
<div id="tabs" class="bs-example bs-example-tab" style="width:1200px; margin-left: 80px;">
  <ul>
    <li><a href="#firstTab">최저가순</a></li>
    <li><a href="#secondTab">최고가순</a></li>
    <li><a href="#thirdTab">CPU성능순</a></li>
    <li><a href="#fourthTab">그래픽성능순</a></li>
  </ul>

  <div id="firstTab">
   	<table>
			<tr align="center">
				<td></td>
				<td width="65">PC ID</td>
				<td>컴퓨터 이름</td>
				<td>가격</td>
				<td>상세설명</td>
			</tr>
			<c:forEach items="${requestScope.result1.lowList}" var="productl">
			<tr align="center">
				<td width="90" height="90">
				<c:choose>
					<c:when test="${productl.fileName!=null }">
						<a href="/${initParam.context_root }/product/detailProduct.do?completeId=${productl.completeId }" >
							<img src="/droowa/product-img/${productl.fileName}" style="width:90px; height=90px;">
						</a>
					</c:when>
					<c:when test="${productl.fileName==null}">
						<a href="/${initParam.context_root }/product/detailProduct.do?completeId=${productl.completeId }" >
							<img src="/droowa/product-img/No_image.jpg" style="width:90px; height=90px;">
						</a>
					</c:when>	
				</c:choose>
				</td>
				<td>${productl.completeId }</td>
				<td>${productl.completeName }</td>
				<td>${productl.completePrice }</td>
				<td>${productl.mainboardName }/${productl.cpuName }/${productl.coolerName }/${productl.memoryName }/
					${productl.graphicName }/${productl.hddName }/${productl.ssdName }/${productl.dvdName }
					${productl.soundName }/${productl.powerName }/${productl.caseName }/${productl.osName }
				</td>
			</tr>
			</c:forEach>
		</table>
	
		<!-- 페이징처리 -->
		<c:if test="${fn:length(requestScope.result1.lowList) != 0 }">
		<table align="center">
			<tr>
				<td>
				<c:choose>
					<c:when test="${requestScope.result1.paging.previousPageGroup}">
						<a href="/droowa/product/getAllProduct.do?tabIndex=0&page=${requestScope.result1.paging.startPageOfPageGroup-1}">◀</a>
					</c:when>
					<c:otherwise>
						◀
					</c:otherwise>
				</c:choose>
				<c:forEach begin="${requestScope.result1.paging.startPageOfPageGroup}" end="${requestScope.result1.paging.endPageOfPageGroup}" step="1" var="page">
					<c:choose>
						<c:when test="${page == requestScope.result1.paging.currentPage }">
							<b>${page}</b>
						</c:when>
						<c:otherwise>
							<a href="/${initParam.context_root}/product/getAllProduct.do?tabIndex=0&page=${page}">${page}</a>
						</c:otherwise>
					</c:choose>
				</c:forEach>
				<c:choose>
					<c:when test="${requestScope.result1.paging.nextPageGroup}">
						<a href="/${initParam.context_root}/product/getAllProduct.do?tabIndex=0&page=${requestScope.result1.paging.endPageOfPageGroup+1}">▶</a>
					</c:when>
					<c:otherwise>
						▶
					</c:otherwise>
				</c:choose>
				</td>
			</tr>
		</table>
		</c:if>
  </div>
  <div id="secondTab">
   		<table>
			<tr align="center">
				<td></td>
				<td width="65">PC ID</td>
				<td>컴퓨터 이름</td>
				<td>가격</td>
				<td>상세설명</td>
			</tr>
			<c:forEach items="${requestScope.result2.highList}" var="producth">
			<tr align="center">
				<td width="90" height="90">
				<c:choose>
					<c:when test="${producth.fileName!=null }">
						<a href="/${initParam.context_root }/product/detailProduct.do?completeId=${producth.completeId }" >
							<img src="/droowa/product-img/${producth.fileName}" style="width:90px; height=90px;">
						</a>
					</c:when>
					<c:when test="${producth.fileName==null}">
						<a href="/${initParam.context_root }/product/detailProduct.do?completeId=${producth.completeId }" >
							<img src="/droowa/product-img/No_image.jpg" style="width:90px; height=90px;">
						</a>
					</c:when>	
				</c:choose>
				</td>
				<td>${producth.completeId }</td>
				<td>${producth.completeName }</td>
				<td>${producth.completePrice }</td>
				<td>${producth.mainboardName }/${producth.cpuName }/${producth.coolerName }/${producth.memoryName }/
					${producth.graphicName }/${producth.hddName }/${producth.ssdName }/${producth.dvdName }
					${producth.soundName }/${producth.powerName }/${producth.caseName }/${producth.osName }
				</td>
			</tr>
			</c:forEach>
		</table>
	
		<c:if test="${fn:length(requestScope.result2.highList) != 0 }">
		<table align="center">
			<tr>
				<td>
				<c:choose>
					<c:when test="${requestScope.result2.paging.previousPageGroup}">
						<a href="/droowa/product/getAllProduct.do?tabIndex=1&page=${requestScope.result2.paging.startPageOfPageGroup-1}">◀</a>
					</c:when>
					<c:otherwise>
						◀
					</c:otherwise>
				</c:choose>
				<c:forEach begin="${requestScope.result2.paging.startPageOfPageGroup}" end="${requestScope.result2.paging.endPageOfPageGroup}" step="1" var="page">
					<c:choose>
						<c:when test="${page == requestScope.result2.paging.currentPage }">
							<b>${page}</b>
						</c:when>
						<c:otherwise>
							<a href="/${initParam.context_root}/product/getAllProduct.do?tabIndex=1&page=${page}">${page}</a>
						</c:otherwise>
					</c:choose>
				</c:forEach>
				<c:choose>
					<c:when test="${requestScope.result2.paging.nextPageGroup}">
						<a href="/${initParam.context_root}/product/getAllProduct.do?tabIndex=1&page=${requestScope.result2.paging.endPageOfPageGroup+1}">▶</a>
					</c:when>
					<c:otherwise>
						▶
					</c:otherwise>
				</c:choose>
				</td>
			</tr>
		</table>
		</c:if>
  </div>
  <div id="thirdTab">
 		<table>
			<tr align="center">
				<td></td>
				<td width="65">PC ID</td>
				<td>컴퓨터 이름</td>
				<td>가격</td>
				<td>상세설명</td>
			</tr>
			<c:forEach items="${requestScope.result3.cpuList}" var="productc">
			<tr align="center">
				<td width="90" height="90">
				<c:choose>
					<c:when test="${productc.fileName!=null }">
						<a href="/${initParam.context_root }/product/detailProduct.do?completeId=${productc.completeId }" >
							<img src="/droowa/product-img/${productc.fileName}" style="width:90px; height=90px;">
						</a>
					</c:when>
					<c:when test="${productc.fileName==null}">
						<a href="/${initParam.context_root }/product/detailProduct.do?completeId=${productc.completeId }" >
							<img src="/droowa/product-img/No_image.jpg" style="width:90px; height=90px;">
						</a>
					</c:when>	
				</c:choose>
				</td>
				<td>${productc.completeId }</td>
				<td>${productc.completeName }</td>
				<td>${productc.completePrice }</td>
				<td>${productc.mainboardName }/${productc.cpuName }/${productc.coolerName }/${productc.memoryName }/
					${productc.graphicName }/${productc.hddName }/${productc.ssdName }/${productc.dvdName }
					${productc.soundName }/${productc.powerName }/${productc.caseName }/${productc.osName }
				</td>
			</tr>
			</c:forEach>
		</table>
	
		<c:if test="${fn:length(requestScope.result3.cpuList) != 0 }">
		<table align="center">
			<tr>
				<td>
				<c:choose>
					<c:when test="${requestScope.result3.paging.previousPageGroup}">
						<a href="/droowa/product/getAllProduct.do?tabIndex=2&page=${requestScope.result3.paging.startPageOfPageGroup-1}">◀</a>
					</c:when>
					<c:otherwise>
						◀
					</c:otherwise>
				</c:choose>
				<c:forEach begin="${requestScope.result3.paging.startPageOfPageGroup}" end="${requestScope.result3.paging.endPageOfPageGroup}" step="1" var="page">
					<c:choose>
						<c:when test="${page == requestScope.result3.paging.currentPage }">
							<b>${page}</b>
						</c:when>
						<c:otherwise>
							<a href="/${initParam.context_root}/product/getAllProduct.do?tabIndex=2&page=${page}">${page}</a>
						</c:otherwise>
					</c:choose>
				</c:forEach>
				<c:choose>
					<c:when test="${requestScope.result3.paging.nextPageGroup}">
						<a href="/${initParam.context_root}/product/getAllProduct.do?tabIndex=2&page=${requestScope.result3.paging.endPageOfPageGroup+1}">▶</a>
					</c:when>
					<c:otherwise>
						▶
					</c:otherwise>
				</c:choose>
				</td>
			</tr>
		</table>
		</c:if>
  </div>
  <div id="fourthTab">
   		<table>
			<tr align="center">
				<td></td>
				<td width="65">PC ID</td>
				<td>컴퓨터 이름</td>
				<td>가격</td>
				<td>상세설명</td>
			</tr>
			<c:forEach items="${requestScope.result4.graphicList}" var="productg">
			<tr align="center">
				<td width="90" height="90">
				<c:choose>
					<c:when test="${productg.fileName!=null }">
						<a href="/${initParam.context_root }/product/detailProduct.do?completeId=${productg.completeId }" >
							<img src="/droowa/product-img/${productg.fileName}" style="width:90px; height=90px;">
						</a>
					</c:when>
					<c:when test="${productg.fileName==null}">
						<a href="/${initParam.context_root }/product/detailProduct.do?completeId=${productg.completeId }" >
							<img src="/droowa/product-img/No_image.jpg" style="width:90px; height=90px;">
						</a>
					</c:when>	
				</c:choose>
				</td>
				<td>${productg.completeId }</td>
				<td>${productg.completeName }</td>
				<td>${productg.completePrice }</td>
				<td>${productg.mainboardName }/${productg.cpuName }/${productg.coolerName }/${productg.memoryName }/
					${productg.graphicName }/${productg.hddName }/${productg.ssdName }/${productg.dvdName }
					${productg.soundName }/${productg.powerName }/${productg.caseName }/${productg.osName }
				</td>
			</tr>
			</c:forEach>
		</table>
	
		<c:if test="${fn:length(requestScope.result4.graphicList) != 0 }">
		<table align="center">
			<tr>
				<td>
				<c:choose>
					<c:when test="${requestScope.result4.paging.previousPageGroup}">
						<a href="/droowa/product/getAllProduct.do?tabIndex=3&page=${requestScope.result4.paging.startPageOfPageGroup-1}">◀</a>
					</c:when>
					<c:otherwise>
						◀
					</c:otherwise>
				</c:choose>
				<c:forEach begin="${requestScope.result4.paging.startPageOfPageGroup}" end="${requestScope.result4.paging.endPageOfPageGroup}" step="1" var="page">
					<c:choose>
						<c:when test="${page == requestScope.result4.paging.currentPage }">
							<b>${page}</b>
						</c:when>
						<c:otherwise>
							<a href="/${initParam.context_root}/product/getAllProduct.do?tabIndex=3&page=${page}">${page}</a>
						</c:otherwise>
					</c:choose>
				</c:forEach>
				<c:choose>
					<c:when test="${requestScope.result4.paging.nextPageGroup}">
						<a href="/${initParam.context_root}/product/getAllProduct.do?tabIndex=3&page=${requestScope.result4.paging.endPageOfPageGroup+1}">▶</a>
					</c:when>
					<c:otherwise>
						▶
					</c:otherwise>
				</c:choose>
				</td>
			</tr>
		</table>
		</c:if>
  </div>
</div>





















